package com.emperor.misc.app;

import java.util.Map;

import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Menu;
import org.eclipse.swt.widgets.MenuItem;
import org.eclipse.swt.widgets.Shell;

import com.emperor.cashier.app.CashierAppCtrl;
import com.emperor.core.app.App;
import com.emperor.core.app.AppBase;
import com.emperor.core.app.AppConstant;
import com.emperor.customer.app.CustomerAppCtrl;
import com.emperor.customer.app.CustomerAppNew;
import com.swtdesigner.SWTResourceManager;

public class HelpAppEnq extends AppBase implements App {

	protected Shell shell;

	public HelpAppEnq() {
		super();
	}

	public HelpAppEnq(Map<String, Object> params) {
		super();
		this.params = params;
	}
	
	/**
	 * Launch the application
	 * @param args
	 */
	public static void main(String[] args) {
		try {
			HelpAppEnq window = new HelpAppEnq();
			window.open();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	/**
	 * Open the window
	 */
	public void open() {
		final Display display = Display.getDefault();
		createContents();
		shell.open();
		shell.layout();
		while (!shell.isDisposed()) {
			if (!display.readAndDispatch())
				display.sleep();
		}
	}

	/**
	 * Create contents of the window
	 */
	protected void createContents() {
		shell = new Shell();
		shell.setBackgroundImage(SWTResourceManager.getImage(HelpAppEnq.class, "/img/main.jpg"));
		shell.setImage(SWTResourceManager.getImage(HelpAppEnq.class, "/img/iMac OSX.png"));
		shell.setFont(SWTResourceManager.getFont("", 12, SWT.NONE));
		shell.setBackgroundMode(SWT.INHERIT_DEFAULT);
		shell.setSize(1000, 700);
		shell.setText("Search Help");
		
		initScreen(shell, getParams());
		//
		buildStandardMenu(getShell(), getParams(), CashierAppCtrl.CASHIER_CTRL, CashierAppCtrl.CASHIER_FORM);

		final Label message = new Label(shell, SWT.WRAP);
		message.setFont(org.eclipse.wb.swt.SWTResourceManager.getFont("Segoe UI", 12, SWT.NORMAL));
		message.setText("This is a Point of Sales system developed for client [Cellnique].");
		message.setBounds(51, 105, 836, 21);

		final Label message_1 = new Label(shell, SWT.WRAP);
		message_1.setBounds(51, 140, 836, 21);
		message_1.setFont(org.eclipse.wb.swt.SWTResourceManager.getFont("Segoe UI", 12, SWT.NORMAL));
		message_1.setText("Version: 1.3");

		final Label message_2 = new Label(shell, SWT.WRAP);
		message_2.setBounds(51, 178, 836, 21);
		message_2.setFont(org.eclipse.wb.swt.SWTResourceManager.getFont("Segoe UI", 12, SWT.NORMAL));
		message_2.setText("(c) Copyright Steven Ho contributors and others 2007, 2008. All rights reserved.");
	}

	public Shell getShell() {
		return shell;
	}
}
